import requests
from api.LoginApi import LoginApi


class TestLoginTP(object):
    session = None

    def setup(self):
        self.session = requests.Session()
        LoginApi.get_verify(self.session)

    def test01_login_seccess(self):
        login_data = {"username": "13800000001", "password": "123456", "verify_code": "8888"}
        resp = LoginApi.login(self.session, login_data)
        print("登录成功：", resp.json())

        assert 200 == resp.status_code
        assert 1 == resp.json().get("status")
        assert "登陆成功" in resp.json().get("msg")